unsigned char IP_TOS_FILL(unsigned char precedence, bool delay, bool throughput, bool reliability) {
	unsigned char tos = 0;
	tos += (precedence << 5);
	if(delay) {
		tos += 16;
	}
	if(throughput) {
		tos += 8;
	}
	if(reliability) {
		tos += 4;
	}
	return tos;
}

unsigned char TCP_Flags(bool ack, bool urgent, bool push, bool reset, bool syn, bool fin) {
	unsigned char flags = 0;
	if(fin)
		flags += 1;
	if(syn)
		flags += 2;
	if(reset)
		flags += 4;
	if(push)
		flags += 8;
	if(ack)
		flags += 16;
	if(urgent)
		flags += 32;
	return flags;
}
